/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.einstein.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Tobe
 */
@Embeddable
public class MovimientomaestroPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "cod_tipo")
    private String codTipo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "num_doc")
    private String numDoc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "compania_id")
    private int companiaId;

    public MovimientomaestroPK() {
    }

    public MovimientomaestroPK(String codTipo, String numDoc, int companiaId) {
        this.codTipo = codTipo;
        this.numDoc = numDoc;
        this.companiaId = companiaId;
    }

    public String getCodTipo() {
        return codTipo;
    }

    public void setCodTipo(String codTipo) {
        this.codTipo = codTipo;
    }

    public String getNumDoc() {
        return numDoc;
    }

    public void setNumDoc(String numDoc) {
        this.numDoc = numDoc;
    }

    public int getCompaniaId() {
        return companiaId;
    }

    public void setCompaniaId(int companiaId) {
        this.companiaId = companiaId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codTipo != null ? codTipo.hashCode() : 0);
        hash += (numDoc != null ? numDoc.hashCode() : 0);
        hash += (int) companiaId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MovimientomaestroPK)) {
            return false;
        }
        MovimientomaestroPK other = (MovimientomaestroPK) object;
        if ((this.codTipo == null && other.codTipo != null) || (this.codTipo != null && !this.codTipo.equals(other.codTipo))) {
            return false;
        }
        if ((this.numDoc == null && other.numDoc != null) || (this.numDoc != null && !this.numDoc.equals(other.numDoc))) {
            return false;
        }
        if (this.companiaId != other.companiaId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.tesla.domain.MovimientomaestroPK[ codTipo=" + codTipo + ", numDoc=" + numDoc + ", companiaId=" + companiaId + " ]";
    }
    
}
